package thesis.main;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MainApp {

	public static void main(String[] args) {

		// user
		// UserJDBCTemplate userJDBCTemplate = (UserJDBCTemplate) context
		// .getBean("userJDBCTemplate");

		// userJDBCTemplate.create("khang", "1111", "admin", "La duy khang",
		// new Date(), "Tpchm", true, "024559062", "87 Bình mỹ",
		// "01224191474", "khangld", new Date(), new Date(), new Date(),
		// true);
		// User user = userJDBCTemplate.getUser(2);
		// System.out.println(user.getName());
		// userJDBCTemplate.delete(2);
		// userJDBCTemplate.update(3,"khang", "2222", "admin", "La duy khang",
		// new Date(), "Tpchm", true, "024559062", "87 Bình mỹ",
		// "01224191474", "khangld", new Date(), new Date(), new Date(),
		// true);

		// /customer
		// CustomerJDBCTemplate customerJDBCTemplate = (CustomerJDBCTemplate)
		// context
		// .getBean("customerJDBCTemplate");
		// customerJDBCTemplate.create("La duy khang", "87", "", "87", new
		// Date(),
		// new Date(), "01224191474", "", "01224191474");
		// Customer customer = customerJDBCTemplate.getCustomer(1);
		// System.out.println(customer.getCustomerName());
		// List<Customer> list = customerJDBCTemplate.listCustomers();
		// for (Customer customer2 : list) {
		// System.out.println(customer2.getCustomerName());
		// }
		// customerJDBCTemplate.delete(1);
		// customerJDBCTemplate.update(3,"La duy Khanh", "87", "", "87", new
		// Date(),
		// new Date(), "01224191474", "", "01224191474");

		// taxiJDBCTemplate.update(1,"11111111111111111111", 7, "8888",
		// "Xe 7 cho",
		// // 1, "89.63545", "103.00990", new Date(), 1, "0909090909", 2000,
		// // true, new Date(), new Date(), "someeeeeee dataaaaaaaaa",
		// // "La duy khang", "0900000001", "khangld", new Date(), "A2",
		// // new Date(), "A12sajdhsadk", 1, new Date(), "024559062");
		// Taxi taxi = taxiJDBCTemplate.getTaxi(9);
		// System.out.println(taxi.getDescription());
		//
		// List<Taxi> taxies = taxiJDBCTemplate.listTaxies();
		// for (Taxi taxi2 : taxies) {
		// System.out.println(taxi2.getDriverEmail());
		// }
		//
		// taxiJDBCTemplate.delete(9);

		// RouteJDBCTemplate routeJDBCTemplate = (RouteJDBCTemplate) context
		// .getBean("routeJDBCTemplate");
		// routeJDBCTemplate.create(1, 2, "89.63545", "103.00990", 50, new
		// Date(),
		// "someeeeeee dataaaaaaaaa");
		// routeJDBCTemplate.update(1, 1, 9, "89.63545", "103.00990", 50,
		// new Date(), "someeeeeee dataaaaaaaaa");
		// Route route = routeJDBCTemplate.getRoute(1);
		// System.out.println(route.getLongitude());
		// List<Route> list = routeJDBCTemplate.listRoutes();
		// for (Route route2 : list) {
		// System.out.println(route2.getLatitude());
		// }
		// routeJDBCTemplate.delete(1);

		try {
			String s = "123456";
			MessageDigest m = MessageDigest.getInstance("MD5");
			m.update(s.getBytes(), 0, s.length());
			System.out.println("MD5: "
					+ new BigInteger(1, m.digest()).toString(16));
		} catch (NoSuchAlgorithmException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		// ServiceJDBCTemplate serviceJDBCTemplate = (ServiceJDBCTemplate)
		// Factory
		// .createJDBCTemplate("serviceJDBCTemplate");
		// System.out.println(new Timestamp((new Date().getTime())));
		// System.out.println(serviceJDBCTemplate.getServiceByPhone("0907785604").getBeginAddress());

		// System.out.println(serviceJDBCTemplate.create(service));

		// TaxiJDBCTemplate taxi = (TaxiJDBCTemplate)
		// Factory.createJDBCTemplate("taxiJDBCTemplate");
		// System.out.println(taxi.getNumberPlateByImei("1111111"));

		// Service service = serviceJDBCTemplate.getService(21);
		// System.out.println(service.getBeginLatitude());
		// List<Service> list = serviceJDBCTemplate.listServices();
		// for (Service service2 : list) {
		// System.out.println(service2.getId());
		// }
		// serviceJDBCTemplate.delete(1);

	}
}
